<?php
//
// +------------------------------------------------------------------------+
// | PHP Version 5.4                                                        |
// +------------------------------------------------------------------------+
// | Copyright (c) All rights reserved.                                     |
// +------------------------------------------------------------------------+
// | 世纪车来车往(北京）网络科技有限公司 版权所有！                               |
// | TEL:010-63732365  HOTLINE:400-6688-365  EMAIL:clcw@clcw.com.cn         |
// | $Revision: 1.0 $                                                       |
// +------------------------------------------------------------------------+
// | Author: xiangminghu@clcw.com.cn                                        |
// +------------------------------------------------------------------------+
//

namespace AuctionBack\Controller;

use AuctionBack\Logic\ClcwCarOmenLogic;
use AuctionBack\Logic\ClcwUserLogic;
use AuctionBack\Logic\ClcwUserSignLogic;
use AuctionCore\Common\AjaxPage;

class UserStatisticsController extends BaseController
{

    private $clcwUserLogic;

    private $empId;

    public function __construct()
    {
        parent::__construct();

        $this->clcwUserLogic = new ClcwUserLogic();

        $this->clcwUserSignLogic = new ClcwUserSignLogic();

        $this->clcwCarOmenLogic = new ClcwCarOmenLogic();

        $this->empId = $this->user_info['emp_id'];
    }


    public function index()
    {
        $this->display();
    }

    /**
     * 兑换积分订单列表
     */
    public function userStatisticsList()
    {
        $page = I("get.p", 1);
        $size = 10;
        $params = [];
        $params['user_id'] = I('get.uid', '', 'trim');
        $params['nick_name'] = I('get.nick_name', '', 'trim');
        $params['user_name'] = I('get.user_name', '', 'trim');
        $params['phone'] = I('get.phone', '', 'trim');
        $params['level'] = I('get.level/d', 1);
        $params['is_expert'] = I('get.is_expert/d', 0);
        $params['status'] = I('get.status/d', 0);
        $params['start_time'] = I('get.start_time', '');
        $params['end_time'] = I('get.end_time', '');
        $params['sort'] = I('get.sort/d', 0);
        $result = $this->clcwUserLogic->getUserStatisticsList($page, $size, $params);
        $list = !empty($result['list']) ? $result['list'] : [];
        $Page = new AjaxPage($result['total'], $size, "get_page");
        $Page->setConfig('theme', " %totalRow% %header% %nowPage%/%totalPage% 页 %first% %upPage% %prePage% %linkPage% %nextPage% %downPage%  %end% %jumpform%");
        $show = $Page->show();          // 分页显示输出
        $this->assign('page', $show);   // 赋值分页输出
        $this->assign('list', $list);
        $this->assign('p', $page);
        $this->assign('total', $result['total']);
        $this->assign('params', $params);
        $this->display();
    }
}
